<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>TODO supply a title</title>
    </h:head>
    <h:body>
        <ui:composition template="./HomeTemp.xhtml">
            <ui:define name="eventcontent">
                
                <h:outputText value="#{loginBean.userLogin}"></h:outputText>
            </ui:define>
            <ui:define name="listevent">
                <div style="width: 78%">
                <h:form id="form" prependId="false">  
                    <p:dataTable var="enroll" value="#{enrollEventBean.registerList}" rowKey="#{enroll.registerId}" paginator="true" rows="10" selection="#{enrollEventBean.registerEntities}" selectionMode="single" widgetVar="userTbl" emptyMessage="No user record was found" id="eventTable">

                        <p:ajax event="rowSelect" update=":form:display" oncomplete="eventDialog.show()" />                 

                        <f:facet name="header">                
                            <h:outputLabel value="List of Event"/> <br/> 
                        </f:facet>                                

                        <p:column headerText="Full Name" sortBy="#{enroll.registerName}" filterBy="#{enroll.registerName}" footerText="contains" filterMatchMode="contains" id="eventname">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{enroll.registerName}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{enroll.registerName}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="User Name" sortBy="#{enroll.userName}" filterBy="#{enroll.userName}" footerText="contains" filterMatchMode="contains" id="eventname">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{enroll.userName}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{enroll.userName}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="Phone" sortBy="#{enroll.phone}" filterBy="#{enroll.phone}" footerText="contains" filterMatchMode="contains" id="eventname">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{enroll.phone}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{enroll.phone}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="Money Number" sortBy="#{enroll.moneyNumber}" filterBy="#{enroll.moneyNumber}" footerText="contains" filterMatchMode="contains" id="eventname">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{enroll.moneyNumber}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{enroll.moneyNumber}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="Address" sortBy="#{enroll.address}" filterBy="#{enroll.address}" footerText="contains" filterMatchMode="contains" id="eventname">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{enroll.address}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{enroll.address}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="Date Create" sortBy="#{enroll.dateCreate}" filterBy="#{enroll.dateCreate}" footerText="contains" filterMatchMode="contains" id="eventname">
                            <p:cellEditor>
                                <f:facet name="output">  
                                    <h:outputText value="#{enroll.dateCreate}" />  
                                </f:facet>  
                                <f:facet name="input">  
                                    <h:outputText value="#{enroll.dateCreate}" style="width:100%"/>  
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        
                    </p:dataTable>
                
                
                    <p:dialog header="User Detail" widgetVar="eventDialog" resizable="true" width="422" showEffect="explode" hideEffect="explode">
                        <h:panelGrid id="display" columns="2" cellpadding="4"> 
                            <h:outputText value="User Name: " />  
                            <h:outputText value="#{registerBean.registerEntities.userName}" id="eventName"/>
                            
                        </h:panelGrid>
                    </p:dialog>
                </h:form>
                </div>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
